<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function sum(num1,num2){
            var result = 0;
            for (var i = 0; i < arguments.length; i++) {
                // if (isNaN(arguments[i])){
                //
                // }else{
                //     result += arguments[i];
                // }
                if (typeof(arguments[i])=="number"){
                    result += arguments[i];
                }
            }
            return result;
        }

        alert(sum(1,2,3,4,32,"abc"));
    </script>
</head>
<body>

</body>
</html>